<template>
    <ButtonGroup>
        <Button :type="change === def?'primary': 'default'" @click="switchV">{{text1}}</Button>
        <Button :type="change !== def?'primary': 'default'" @click="switchV">{{text2}}</Button>
    </ButtonGroup>
</template>

<script>
    export default {
        data(){
          return {
              change: true
          }
        },
        created(){
            this.change = this.value;
        },
        props:{
            value: {
                type: Boolean
            },
            def: {
                type: Boolean,
                default: true
            },
            text1: String,
            text2: String
        },
        methods:{
            switchV(){
                this.change = !this.change;
                this.$emit('input', this.change);
            }
        }
    }
</script>

<style scoped>

</style>